home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / lrnvb615 / example4.frm (.txt) < prev    next >
Visual Basic Form  |  1998-09-10  |  5KB  |  149 lines

  1. VERSION 5.00
  2. Begin VB.Form frmTemp 
  3.    BorderStyle     =   1  'Fixed Single
  4.    Caption         =   "Temperature Conversion"
  5.    ClientHeight    =   3480
  6.    ClientLeft      =   1470
  7.    ClientTop       =   1515
  8.    ClientWidth     =   4815
  9.    LinkTopic       =   "Form1"
  10.    MaxButton       =   0   'False
  11.    MinButton       =   0   'False
  12.    PaletteMode     =   1  'UseZOrder
  13.    ScaleHeight     =   3480
  14.    ScaleWidth      =   4815
  15.    StartUpPosition =   2  'CenterScreen
  16.    Begin VB.CommandButton cmdExit 
  17.       Cancel          =   -1  'True
  18.       Caption         =   "E&xit"
  19.       Height          =   495
  20.       Left            =   3360
  21.       TabIndex        =   5
  22.       Top             =   2760
  23.       Width           =   1215
  24.    End
  25.    Begin VB.VScrollBar vsbTemp 
  26.       Height          =   2895
  27.       LargeChange     =   10
  28.       Left            =   2280
  29.       Max             =   -60
  30.       Min             =   120
  31.       TabIndex        =   0
  32.       Top             =   240
  33.       Value           =   32
  34.       Width           =   255
  35.    End
  36.    Begin VB.Label lblTempC 
  37.       Alignment       =   2  'Center
  38.       AutoSize        =   -1  'True
  39.       BackColor       =   &H00FFFFFF&
  40.       BorderStyle     =   1  'Fixed Single
  41.       Caption         =   "0"
  42.       BeginProperty Font 
  43.          Name            =   "MS Sans Serif"
  44.          Size            =   13.5
  45.          Charset         =   0
  46.          Weight          =   700
  47.          Underline       =   0   'False
  48.          Italic          =   0   'False
  49.          Strikethrough   =   0   'False
  50.       EndProperty
  51.       Height          =   420
  52.       Left            =   3360
  53.       TabIndex        =   4
  54.       Top             =   1320
  55.       Width           =   255
  56.    End
  57.    Begin VB.Label Label4 
  58.       Alignment       =   2  'Center
  59.       Caption         =   "Celsius"
  60.       BeginProperty Font 
  61.          Name            =   "MS Sans Serif"
  62.          Size            =   9.75
  63.          Charset         =   0
  64.          Weight          =   700
  65.          Underline       =   0   'False
  66.          Italic          =   0   'False
  67.          Strikethrough   =   0   'False
  68.       EndProperty
  69.       Height          =   495
  70.       Left            =   2880
  71.       TabIndex        =   3
  72.       Top             =   960
  73.       Width           =   1215
  74.    End
  75.    Begin VB.Label lblTempF 
  76.       Alignment       =   2  'Center
  77.       AutoSize        =   -1  'True
  78.       BackColor       =   &H00FFFFFF&
  79.       BorderStyle     =   1  'Fixed Single
  80.       Caption         =   "32"
  81.       BeginProperty Font 
  82.          Name            =   "MS Sans Serif"
  83.          Size            =   13.5
  84.          Charset         =   0
  85.          Weight          =   700
  86.          Underline       =   0   'False
  87.          Italic          =   0   'False
  88.          Strikethrough   =   0   'False
  89.       EndProperty
  90.       Height          =   420
  91.       Left            =   1110
  92.       TabIndex        =   2
  93.       Top             =   1320
  94.       Width           =   435
  95.    End
  96.    Begin VB.Label Label1 
  97.       Alignment       =   2  'Center
  98.       Caption         =   "Fahrenheit"
  99.       BeginProperty Font 
  100.          Name            =   "MS Sans Serif"
  101.          Size            =   9.75
  102.          Charset         =   0
  103.          Weight          =   700
  104.          Underline       =   0   'False
  105.          Italic          =   0   'False
  106.          Strikethrough   =   0   'False
  107.       EndProperty
  108.       Height          =   495
  109.       Left            =   720
  110.       TabIndex        =   1
  111.       Top             =   960
  112.       Width           =   1215
  113.    End
  114.    Begin VB.Shape Shape1 
  115.       BackColor       =   &H00FFFFFF&
  116.       BackStyle       =   1  'Opaque
  117.       FillColor       =   &H000000FF&
  118.       FillStyle       =   7  'Diagonal Cross
  119.       Height          =   3135
  120.       Left            =   2040
  121.       Shape           =   4  'Rounded Rectangle
  122.       Top             =   120
  123.       Width           =   735
  124.    End
  125. Attribute VB_Name = "frmTemp"
  126. Attribute VB_GlobalNameSpace = False
  127. Attribute VB_Creatable = False
  128. Attribute VB_PredeclaredId = True
  129. Attribute VB_Exposed = False
  130. Option Explicit
  131. Dim TempF As Integer
  132. Dim TempC As Integer
  133. Private Sub cmdExit_Click()
  134. End Sub
  135. Private Sub vsbTemp_Change()
  136. 'Read F and convert to C
  137. TempF = vsbTemp.Value
  138. lblTempF.Caption = Str(TempF)
  139. TempC = CInt((TempF - 32) * 5 / 9)
  140. lblTempC.Caption = Str(TempC)
  141. End Sub
  142. Private Sub vsbTemp_Scroll()
  143. 'Read F and convert to C
  144. TempF = vsbTemp.Value
  145. lblTempF.Caption = Str(TempF)
  146. TempC = CInt((TempF - 32) * 5 / 9)
  147. lblTempC.Caption = Str(TempC)
  148. End Sub
  149.